#ifndef WIDGET_H
#define WIDGET_H

#include <QTimer>
#include <QWidget>

extern "C" {
#include "daq331m.h"
}

//#define USE_MODBUS
#define USE_TCP_CLIENT
//#define USE_RS485

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:

    void ProcessData();

    void on_ConnectPushButton_clicked();

    void on_StartPushButton_clicked();

    void on_StopPushButton_clicked();

private:
    Ui::Widget *ui;
    QTimer *timer_;
    uint8_t channel_state = 0xFF;
    daq331m_ptr daq331m_;
    QVector<QColor> channel_color_list_ = {
        Qt::black, Qt::red, Qt::blue, Qt::darkGreen,
        QColor(0, 197, 205), Qt::magenta, QColor(139, 69, 19), QColor(255, 165, 0),
    };
};
#endif // WIDGET_H
